<include file="Public/min-header" />
<style>
    .col100{width:100px;text-align:center;float:left;display:inline;border-right:1px solid #0080FF;}
    .col150{width:150px;text-align:center;float:left;display:inline;border-right:1px solid #0080FF;}
    .col300{width:300px;text-align:center;float:left;display:inline;border-right:1px solid #0080FF;}
    .coltop{border-top:1px solid #0080FF;}
    .colno{border-right:none;}
    .wrapper{min-height:1000px!important;}
</style>
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <nav class="navbar navbar-default">
                            <div class="collapse navbar-collapse">
                                <form class="navbar-form form-inline" action="{:U('Order/index')}" method="post">
                                    <div class="form-group">
                                        <input type="text" name="keywords" class="form-control" placeholder="订单号">
                                    </div>
                                    <div class="form-group">
                                        <select name="store_id" class="form-control">
                                            <option>请选择出品者</option>
											<foreach name="user_list" item="v" key="k">
												<option value="{$v['id']}"> {$v['realname']}</option>
											</foreach>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <select name="order_status" class="form-control">
                                            <option <if condition="$order_status eq 'all'">selected</if> value="all">请选择订单状态</option>
											<option <if condition="$order_status eq 4">selected</if> value="4">待发货</option>
											<option <if condition="$order_status eq 1">selected</if> value="1">已发货</option>
											<option <if condition="$order_status eq 2">selected</if> value="2">交易完成</option>
											<option <if condition="$order_status eq 3">selected</if> value="3">已取消</option>
                                        </select>
                                    </div>
                                    <button type="submit" class="btn btn-primary">提交</button>
                                </form>
                            </div>
                        </nav>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable">
                                    <thead>
                                    <tr role="row">
                                        <th>ID</th>
                                        <th width="180">订单号</th>
                                        <th>收货人</th>
                                        <th>联系方式</th>
                                        <th>收货地址</th>
                                        <th>支付方式</th>
                                        <th>订单金额</th>
                                        <th>订单状态</th>
                                        <th>下单时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="order_list" item="vo" key="k">
                                        <tr role="row" align="center">
                                            <td style="line-height:34px;">{$vo.id}</td>
                                            <td class="order_sn" align="left" style="position:relative;">
                                                <div style="line-height:34px;">{$vo['order_sn']}</div>
                                            </td>
                                            <td align="left" style="line-height:34px;">{$vo.consignee}</td>
                                            <td align="left" style="line-height:34px;">{$vo.mobile}</td>
                                            <td align="left" style="line-height:34px;">{$vo.address}</td>
                                            <td align="left" style="line-height:34px;">{$vo.pay_name}</td>
                                            <td align="left" style="line-height:34px;">{$vo.price}</td>
                                            <td align="left" style="line-height:34px;">
                                                <if condition="$vo['order_status'] eq 1">
                                                    <span style="color:red;">已发货</span>
                                                <elseif condition="$vo['order_status'] eq 2" />
                                                    <span style="color:red;">交易完成</span>
                                                <elseif condition="$vo['order_status'] eq 3" />
                                                    <span style="color:orange;">已取消</span>
												<else />
                                                    <span style="color:green;">待发货</span>
                                                </if>
                                            </td>
                                            <td align="left" style="line-height:34px;">{$vo.add_time|date="Y-m-d H:i:s",###}</td>
                                            <td style="line-height:34px;">
                                                <a class="btn btn-info" href="{:U('Admin/Order/detail',array('id'=>$vo['id']))}"><i class="fa fa-eye"></i></a>
												<if condition="$vo['order_status'] eq 3">
                                               	 <a class="btn btn-danger" onClick="delfun({$vo['id']})"><i class="fa fa-trash-o"></i></a>
												</if>
                                            </td>
                                        </tr>
                                    </foreach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
</body>
<script>
    $('.order_sn').mouseenter(function(){
        $(this).find('.goods_list').show();
    }).mouseleave(function(){
        $(this).find('.goods_list').hide();
    });
	function delfun(id) {
        layer.open({
            content: '您确定要删除吗？'
            ,btn: ['确定', '不要']
            ,yes: function(index){
                $.post('/Admin/Order/order_cancle/',{order_id:id},function(data){
                    if(data.code==200){
                        window.location = '/Admin/Order/index';
                    }
                },'json');
            }
        });
    }
</script>
</html>
